package com.csweimei.rentmanagementtreasure.http.entity;

import android.view.View;

import com.csweimei.rentmanagementtreasure.utils.ValidateUtils;
import com.google.gson.annotations.SerializedName;

import java.util.List;

public class CustomerFollowBean extends BaseResult{
    @SerializedName("data")
    private List<DataDTO> data;

    public List<DataDTO> getData() {
        return data;
    }

    public void setData(List<DataDTO> data) {
        this.data = data;
    }

    public static class DataDTO {
        @SerializedName("id")
        private int id;
        @SerializedName("userid")
        private int userid;
        @SerializedName("FollowTime")
        private String followTime;
        @SerializedName("FollowInfo")
        private String followInfo;
        @SerializedName("FollowImg")
        private String followImg;
        @SerializedName("housingid")
        private int housingid;
        @SerializedName("housingImg")
        private String housingImg;
        @SerializedName("housingName")
        private String housingName;
        @SerializedName("quarters")
        private String quarters;

        public String getQuarters() {
            return quarters;
        }

        public void setQuarters(String quarters) {
            this.quarters = quarters;
        }

        @SerializedName("rent")
        private String rent;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getUserid() {
            return userid;
        }

        public void setUserid(int userid) {
            this.userid = userid;
        }

        public String getFollowTime() {
            return ValidateUtils.getTimeForm(followTime);
        }

        public void setFollowTime(String followTime) {
            this.followTime = followTime;
        }

        public String getFollowInfo() {
            return followInfo;
        }

        public void setFollowInfo(String followInfo) {
            this.followInfo = followInfo;
        }

        public String getFollowImg() {
            return followImg;
        }

        public void setFollowImg(String followImg) {
            this.followImg = followImg;
        }

        public int getHousingid() {
            if (housingid != 0){
                return View.VISIBLE;
            }else {
                return View.GONE;
            }
        }

        public void setHousingid(int housingid) {
            this.housingid = housingid;
        }

        public String getHousingImg() {
            if (housingImg.contains(",")){
                return housingImg.split(",")[0];
            }else {
                return housingImg;
            }
        }

        public void setHousingImg(String housingImg) {
            this.housingImg = housingImg;
        }

        public String getHousingName() {
            return housingName;
        }

        public String getTitle() {
            return quarters+housingName;
        }

        public void setHousingName(String housingName) {
            this.housingName = housingName;
        }

        public String getRent() {
            if (ValidateUtils.isEmptyString(rent)){
                return "面议";
            }else {
                return rent+"元/月";

            }
        }

        public void setRent(String rent) {
            this.rent = rent;
        }
    }
}
